﻿@using FotoLab.Models;
@using FotoLab.Controllers;

@model IEnumerable<FotoLab.DomainLayer.Model.Product>

@{
    ViewBag.Title = "Producten";
    int counter = 0;
}
<style>
    body {
        background-image: url('../../Content/bgproduct.jpg');
        background-size: cover;
    }
</style>
<div class="row">
    @if (ViewBag.listProducts == null || ViewBag.listProducts.Count < 1)
    {
        <div class="col-md-12 spacer" style="min-height: 200px"></div>
        <div class="row center">
            <p style="text-align: center;"><img style="max-width: 250px; height: auto;" src="~/Content/error-mesage.png" /></p>
            <p style="font-size: 50px;color:white">GEEN PRODUCTEN</p>
        </div>
    }
    else
    {
        <table class="table">
            <tr>
                <th>
                    @Html.DisplayNameFor(model => model.Naam)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Prijs)
                </th>
            </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Naam)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Prijs)
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new {id = item.Id})
                </td>
                <td>
                    @Html.ActionLink("Delete", "Delete", new {id=item.Id})
                </td>
            </tr>
        }
        </table>
    }
</div>

